<?php
/**
 * Created by PhpStorm.
 * User: 戎大富
 * Date: 2019/6/19
 * Time: 14:12
 */
namespace app\admin\controller;
use think\Db;
class Books extends Base {
    public function index(){
        if(request()->isAjax ()){
            extract(input());
            $Nowpage = input('page') ? input('page'):1;
            $limits = input("limit")?input("limit"):10;// 获取总条数;
            $count = Db::name('book_type')->count();
            $lists = Db::name('book_type')
                ->page($Nowpage,$limits)
                ->select ();
            return json(['code'=>220,'msg'=>'','count'=>$count,'data'=>$lists]);
        }
        return $this->fetch();
    }
}